package org.lex.lang;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class AggregateRuntimeException extends RuntimeException {
	private static final long serialVersionUID = 594772376840073509L;
	private List<Exception> exceptionList = new ArrayList<Exception>();

	public AggregateRuntimeException(Exception... exceptions) {
		for (Exception e : exceptions) {
			this.exceptionList.add(e);
		}
	}

	public AggregateRuntimeException(Collection<Exception> exceptions) {
		this.exceptionList.addAll(exceptions);
	}

	public List<Exception> getExceptions() {
		return Collections.unmodifiableList(exceptionList);
	}
}
